package com.jdk.learn.juc2.random;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

/**
 * 类功能描述:
 *
 * @author bgt
 * @version V1.0
 * @since 2019-02-05 10:23
 */
public class RandomDemo {
    public static void main(String[] args) {
        Random random2=new Random();
        ThreadLocalRandom random=ThreadLocalRandom.current();
        for (int i = 0; i < 5; i++) {
            System.out.println(random.nextInt(5));
            System.out.println(random2.nextInt(5));
        }
    }
}
